Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #6866 client side cache when running with web sockets #7182

Merged
merged 8 commits into from
Aug 5, 2024

Conversation

moellep
Copy link
Member

@moellep moellep commented Jul 18, 2024

Also includes some improvements for appState.deepCopy() and openmc save calls.

@@ -1556,14 +1544,155 @@ SIREPO.app.service('validationService', function(utilities) {

});

SIREPO.app.factory('srCache', function(appState, $rootScope) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@e-carlin and @robnagler srCache is the client side cache for web sockets, using indexedDB

Copy link
Member

@robnagler robnagler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the naming needs to be more consistent.

sirepo/package_data/static/js/sirepo.js Outdated Show resolved Hide resolved
sirepo/package_data/static/js/sirepo.js Outdated Show resolved Hide resolved
sirepo/package_data/static/js/sirepo.js Outdated Show resolved Hide resolved
sirepo/package_data/static/js/sirepo.js Outdated Show resolved Hide resolved
sirepo/package_data/static/js/sirepo.js Outdated Show resolved Hide resolved
}
};
c.onerror = () => {
invokeCallback(callback, null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to log the error even for debugging purposes? Do we want an errorCallback?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to log every getFrame() call if it fails. Possibly the first failure. The caller can't really do any additional handling other than treating it as a cache-miss.

};
}

self.clearFrames = (simId, modelName) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having frames and generic "object" seems odd to me. This is srFrameCache or something like that.

sirepo/package_data/static/js/sirepo.js Outdated Show resolved Hide resolved
sirepo/package_data/static/js/sirepo.js Outdated Show resolved Hide resolved
sirepo/package_data/static/js/sirepo.js Outdated Show resolved Hide resolved
Copy link
Member

@e-carlin e-carlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple comments but overall looks good and worked well.

sirepo/package_data/static/js/sirepo.js Outdated Show resolved Hide resolved
sirepo/package_data/static/js/sirepo.js Outdated Show resolved Hide resolved
@moellep moellep merged commit 8a2be83 into master Aug 5, 2024
3 checks passed
@moellep moellep deleted the 6866-local-storage branch August 5, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants